﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SemenQuest.Interfaces;
namespace SemenQuest.Communication
{
    public class Message : IMessage<Message.MessageTypes,Message.Contents>
    {
        public Guid Sender { get; private set; }
        public Guid Receiver { get; private set; }
        public MessageTypes Type { get; private set; }
        public Contents Content { get; private set; }
        public Object AdditionalInformation { get; private set; }
        public DateTime Recieved { get; set; }
        public DateTime Created { get; private set; }

        public enum MessageTypes
        {
            Inform, NotUnderstood, Unresponsive, Request, Agree, Refuse
        }
        public enum Contents
        {
            EggFound, EggImpregnated, SwimTogether, Impregnate, YouImpregnatedTheEgg, YouDidNotImpregnateTheEgg, AlreadyInTeam, InTeamAsTeamLeader, Nothing
        }

        public Message(Guid sender, Guid receiver, MessageTypes type, Contents content)
        {
            this.Sender = sender;
            this.Receiver = receiver;
            this.Type = type;
            this.Content = content;
            this.Created = DateTime.Now;
        }

        public Message(Guid sender, Guid receiver, MessageTypes type, Contents content, Object additionalInformation)
            : this(sender, receiver, type, content)
        {
            this.AdditionalInformation = additionalInformation;
        }

    }
}
